//
//  HYOUScrollWebViewController.m
//  BestGift
//
//  Created by 温晓宇 on 16/1/6.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "HYOUScrollWebViewController.h"
#import "UMSocial.h"
@interface HYOUScrollWebViewController ()

@property(nonatomic, retain)UIWebView *webView;

@end

@implementation HYOUScrollWebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UIImage *image = [[UIImage imageNamed:@"iconfont-fenxiang"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:self action:@selector(rightAction:)];
    
    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
    NSString *string = self.url;
    NSURL *url = [NSURL URLWithString:string];
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
    [self.webView loadRequest:request];
    
    [self.view addSubview:self.webView];
    [_webView release];
}
-(void)rightAction:(UIBarButtonItem *)btn{
    [UMSocialSnsService presentSnsIconSheetView:self
                                         appKey:@"568dcee0e0f55afe6f001e85"
                                      shareText:[NSString stringWithFormat:@"很不错可以看看~~%@",self.url]
                                     shareImage:[UIImage imageNamed:@"icon.png"]
                                shareToSnsNames:nil
                                       delegate:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
